Deriving vacuum FRW equations directly from action

Using the Einstein-Hilbert action for a Universe with just the cosmological constant $$\Lambda$$:

$$S=\int\Big[\frac{R}{2}-\Lambda\Big]\sqrt{-g}\ d^4x$$

I would like to derive the equations of motion:

$$\Big(\frac{\dot a}{a}\Big)^2+\frac{k}{a^2}=\frac{\Lambda}{3}\tag{1}$$

$$2\frac{\ddot a}{a}+\Big(\frac{\dot a}{a}\Big)^2+\frac{k}{a^2}=\Lambda\tag{2}$$

I use the FRW metric to substitute in

$$R=\frac{6}{a^2}(a\ddot a+\dot a^2+k)$$

and

$$\sqrt{-g} \propto a^3$$

I then have the following Euler-Lagrange equation for derivatives of $$a(t)$$:

$$\frac{\partial L}{\partial a}-\frac{d}{dt}\frac{\partial L}{\partial \dot a}+\frac{d^2}{dt^2}\frac{\partial L}{\partial \ddot a}=0$$

This gives me equation $$(2)$$.

How would I get equation $$(1)$$ using this approach?

You need to allow for time reparameterization. In other words, you should include the so-called lapse in your metric

$$$$g_{\mu\nu} dx^\mu dx^\nu = -N(t)^2 dt^2 + a(t)^2 dx^2$$$$

If you carry $$N$$ through your calculation of $$\sqrt{-g}$$ and $$R$$ and then vary the action with respect to $$N$$, you will arrive at the first Friedman equation.